package com.shetou.yun.activity;

import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.Button;
import android.widget.ImageView;

import com.bumptech.glide.Glide;
import com.shetou.yun.R;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;

public class MainActivity extends AppCompatActivity {

    @BindView(R.id.imageView)
    ImageView imageView;
    @BindView(R.id.button)
    Button button;
    @BindView(R.id.im_zhanshi)
    ImageView imZhanshi;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        ButterKnife.bind(this);
        Glide.with(MainActivity.this).load(R.drawable.sd).asGif().into(imZhanshi);
//        Glide.with(MainActivity.this).load(url).asGif().diskCacheStrategy(DiskCacheStrategy.SOURCE).into(imageView);
    }

    @OnClick({R.id.imageView, R.id.button})
    public void onViewClicked(View view) {
        switch (view.getId()) {
            case R.id.imageView:
                finish();
                break;
            case R.id.button:
//                new Handler().postDelayed(new Runnable() {
//                    @Override
//                    public void run() {
                         startActivity(new Intent(MainActivity.this, PhotoActivity.class));
//                    }
//                },1000);

                break;
        }
    }
}
